/*
 * Copyright (c) 2018. 玺得（深圳）科技有限公司.保留所有权利. http://www.pi-top.com/ 玺得（深圳）科技有限公司保留所有代码著作权.如有任何疑问请访问官方网站与我们联系. 代码只针对特定需求定制编码，不得在未经允许或授权的情况下对外传播扩散.恶意传播者，法律后果自行承担. 本代码仅用于pps-cloud系统.
 */
package com.pitop.sync.service;

import com.pitop.box.entity.Box;
import com.pitop.customer.entity.Customer;
import com.pitop.order.entity.Order;
import com.pitop.sync.api.SyncDataTraceFeignApi;
import com.pitop.test.entity.TestRecord;
import com.pitop.test.entity.TestUnit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 测试件，测试硬件单元
 *
 * @author pi-top
 */
@Service("syncFactorySVImpl")
@Slf4j
public class SyncFactorySVImpl {

    @Autowired
    private SyncDataTraceFeignApi syncDataTraceFeignApi;


    /**
     * 从工厂端往云端同步数据
     *
     * @param testUnitList 数据集合
     * @return true/false
     */
    public boolean upwardsSyncTestUnit(List<TestUnit> testUnitList) {
        return syncDataTraceFeignApi.upwardsSyncTestUnit(testUnitList);

    }

    /**
     * 从工厂端往云端同步数据
     *
     * @param testRecordList 数据集合
     * @return true/false
     */
    public boolean upwardsSyncTestRecord(List<TestRecord> testRecordList) {
        return syncDataTraceFeignApi.upwardsSyncTestRecord(testRecordList);
    }

    /**
     * 从工厂向云端同步箱库存数据
     */
    public boolean upwardsSyncBox(List<Box> boxList) {
        return syncDataTraceFeignApi.upwardsSyncBox(boxList);
    }


    /**
     * 从工厂向云端同步箱用户数据
     */
    public boolean upwardsSyncCustomer(List<Customer> customerList) {
        return syncDataTraceFeignApi.upwardsSyncCustomer(customerList);
    }


    /**
     * 从工厂向云端同步箱订单数据
     */
    public boolean upwardsSyncOrder(List<Order> orderList) {
        return syncDataTraceFeignApi.upwardsSyncOrder(orderList);
    }


}
